<%@page import="com.tqz.dao.NewsSerch_tech"%>
<%@page import="com.tqz.dao.NewsSerch_sports"%>
<%@page import="com.tqz.dao.NewsSerch_society"%>
<%@page import="com.tqz.dao.NewsSerch_outcountry"%>
<%@page import="com.tqz.dao.NewsSerch_incountry"%>
<%@page import="com.tqz.dao.NewsSerch_entertainment"%>
<%@page import="com.tqz.dao.NewsSerch_army"%>
<%@page import="com.tqz.model.Article"%>
<%@page import="java.util.List"%>
<%@page import="com.tqz.dao.NewsSerch"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="css/newsdetail.css">
<title>详细新闻</title>
</head>
<body>
	<div id="head">
		<div class="logo">
			<img src="picture/logo.png">
		</div>
		<div class="title">
			<span>知天下</span>
		</div>
		<c:if test="${ username == null }">
			<div class="login">
			<a href="<%=request.getContextPath()%>/adminlogin.jsp">管理员登陆</a>
		</div>
		</c:if>
		<c:if test="${ username != null }">
			<div class="login">
			<a href="<%=request.getContextPath()%>/loginsuccess.jsp">当前用户：admin</a>
		</div>
		</c:if>
	</div>
	<div id="nav">
		<div class="navblock">
			<ul>
				<li><a href="#" class="detail">详细信息</a></li>
			</ul>
		</div>
	</div>
		<%
		    int id = 1;
		    try {
		    	id = Integer.valueOf(request.getParameter("id"));   
		    } catch(Exception e) {
		    	id = 1;
		    }
		   String className = request.getParameter("className");
		   
			
			if(className.equals("NewsSerch")){
				NewsSerch newsSerch = new NewsSerch();
				Article article = new Article();
				article = newsSerch.getArticle(id);//根据传过来的id，查询具体的新闻信息
				request.setAttribute("article", article);
				}else if(className.equals("NewsSerch_army")){
				NewsSerch_army newsSerch = new NewsSerch_army();
				Article article = new Article();
				article = newsSerch.getArticle(id);//根据传过来的id，查询具体的新闻信息
				request.setAttribute("article", article);
				}else if(className.equals("NewsSerch_entertainment")){
				NewsSerch_entertainment newsSerch = new NewsSerch_entertainment();
				Article article = new Article();
				article = newsSerch.getArticle(id);//根据传过来的id，查询具体的新闻信息
				request.setAttribute("article", article);
				}else if(className.equals("NewsSerch_incountry")){
				NewsSerch_incountry newsSerch = new NewsSerch_incountry();
				Article article = new Article();
				article = newsSerch.getArticle(id);//根据传过来的id，查询具体的新闻信息
				request.setAttribute("article", article);
				}else if(className.equals("NewsSerch_outcountry")){
				NewsSerch_outcountry newsSerch = new NewsSerch_outcountry();
				Article article = new Article();
				article = newsSerch.getArticle(id);//根据传过来的id，查询具体的新闻信息
				request.setAttribute("article", article);
				}else if(className.equals("NewsSerch_society")){
				NewsSerch_society newsSerch = new NewsSerch_society();
				Article article = new Article();
			    article = newsSerch.getArticle(id);//根据传过来的id，查询具体的新闻信息
				request.setAttribute("article", article);
				}else if(className.equals("NewsSerch_sports")){
				NewsSerch_sports newsSerch = new NewsSerch_sports();
				Article article = new Article();
				article = newsSerch.getArticle(id);//根据传过来的id，查询具体的新闻信息
				request.setAttribute("article", article);
				}else if(className.equals("NewsSerch_tech")){
				NewsSerch_tech newsSerch = new NewsSerch_tech();
				Article article = new Article();
				article = newsSerch.getArticle(id);//根据传过来的id，查询具体的新闻信息
				request.setAttribute("article", article);
				}else{
					System.out.println("error!");
				}
				
			
		%>
	<div id="mainbody">
		<div class="newstitle">
			<h2><c:out value="${ article.getTitle() }"></c:out></h2>
		</div>
		<div class="newstext">
			<p>
			<c:out value="${ article.getContent() }"></c:out>
			</p>
		</div>
	</div>
	<div id="bottom">
		<div class="text">Copyright ©2018-2018 ZTX</div>
	</div>
</body>
</html>
